using System;
using System.Drawing;
using System.Windows.Forms;
class HelloWorld :Form
{
	public HelloWorld()
	{
		Text="HelloWorld";
		BackColor=Color.White;
	}
	protected override void OnPaint(PaintEventArgs pea)
	{
		base.OnPaint(pea);
		Graphics g=pea.Graphics;
		g.DrawString("Hello World",Font,Brushes.BlueViolet,0,0);
	}
}
class InheritHello
{
	public  static void Main()
	{
		HelloWorld hw=new HelloWorld();
		hw.Paint+=new PaintEventHandler(MyPaintEventHandler);
        Application.Run(hw);
	}
	static void MyPaintEventHandler(object objSender,PaintEventArgs pea)
	{
		Form form=(Form)objSender;
		Graphics g=pea.Graphics;
		g.DrawString("Hello ",form.Font,Brushes.Black,0,100);
	}
}